package kr.kwakyc.puzzle;

import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Image;
import java.awt.image.BufferedImage;

import javax.swing.JPanel;

public class SolutionPanel extends JPanel {
	
	private BufferedImage image;
	
	public SolutionPanel(Image image){
		this.setPreferredSize(new Dimension(200, 200));
		
		BufferedImage bufferedImage = new BufferedImage(200, 200, BufferedImage.TYPE_INT_ARGB);
		Graphics2D g2d = bufferedImage.createGraphics();
		g2d.drawImage(image, 0, 0, 200, 200, 0, 0, image.getWidth(null), image.getHeight(null), null);
		g2d.dispose();
		
		this.image = bufferedImage;
	}
	
	@Override
	public void paint(Graphics g) {
		g.drawImage(image, 0, 0, null);
	}

}
